<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="inc/head.jsp" %>
<script type="text/javascript">
    function toPage(pageNo) {
        var theForm = document.getElementById("searchForm2");
        if ($.trim($("#search_page_keywords").val()).length == 0) {
            $("#search_page_keywords").focus();
            return;
        }
        theForm.action = "/search/" + pageNo;
        theForm.submit();
    }
</script>
<div class="main">
  
  <!--面包屑-->
    <form name="searchForm2" id="searchForm2" method="post">
   <div class="breadcrumbgezi gezidi">
     <b>当前位置：</b>&nbsp;&nbsp;<a><b>首页</b></a> > <span class="last">搜索结果页</span>
    </div>
    <div class="searchall">
     <table class="search_rust" width="" border="0">
      <tr>
       <td class="sr ">输入关键字：</td>
       <td class="kuang">
        <input id="search_page_keywords" type="text" name="keywords" value="${keywords }"/>
       </td>
       <td class="buttons">
       <input type="submit" value="搜索" />
       </td>
      </tr>
     </table>
     
     <div class="sear_02 ">
      搜索 <font class="font1" >${keyword}</font> 获得约<font class="font1" >${page.totalCount}</font> 条结果， 以下是第 <font class="font1" >${page.first}-${page.last}</font> 条。
      </div>
        <c:forEach var="contentEntity" items="${page.result}">
            <div class="stitle">
             <a href="/${contentEntity.location}/${contentEntity.id}">${contentEntity.title}</a>
            </div>
            <div class="scont">
              ·${contentEntity.content}...
            </div>
        </c:forEach>
      <div class="nextpages">
     <span class="starts"> 共${page.totalCount}条记录</span>  <span class="previous">共${page.lastPage}页</span>
          <a href="#" onclick="toPage('${page.prePage}');">上一页</a>
          <c:forEach var="pageNo" begin="1" end="${page.lastPage}">
              <c:if test="${pageNo eq page.pageNo}">
                  <a href="#" onclick="toPage('${pageNo}')" class="page-cur" >${pageNo}</a>
              </c:if>
              <c:if test="${pageNo ne page.pageNo}">
                  <a href="#" onclick="toPage('${pageNo}')">${pageNo}</a>
              </c:if>
          </c:forEach>
          <a href="#" onclick="toPage('${page.nextPage}');">下一页</a>
          <a href="#" onclick="toPage('${page.lastPage}');">末页</a>
      </div>
    </div>
    </form>
</div>
<%@include file="inc/footer.jsp" %>
